#if !defined(__AUDIO_H)
#define __AUDIO_H

#include "commun/sous_systeme.h"
#include "commun/utilise_sdl.h"
#include "chargeur_de_notes.h"
#if defined(__MACOSX__)
#include "SDL_mixer.h"
#else
#include "SDL/SDL_mixer.h"
#endif

#define TAILLE_BUFFER_AUDIO 512

extern const char ouverture_audio[];

class lecture_son;

struct audio {
	enum {
		frequence_echantillonnage = 44100,
		nb_canaux_lecture = 1,
		taille_tampon = 1024,
		nb_pistes = 8
	};
	static void initialiser();
	static void fermer();
};

class module_audio : public sous_systeme<audio> {
public:
	chargeur_de_notes repertoire_des_notes;
	
	static module_audio &instance() {
		return static_cast<module_audio&>(sous_systeme<audio>::instance());
	}
	
	module_audio() throw(erreur);
	~module_audio() throw() {}
	
	void jouer(lecture_son &s);
};

#endif
